package org.crazyit.activiti_d4._1_AddDeleteUserInfo;

import org.activiti.engine.IdentityService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.crazyit.activiti_d3._3_UpdateUser.UpdateUser;

import java.util.UUID;

public class AddDeleteUserInfo {

    public static void main(String[] args) {

        //1. 创建流程引擎
        ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

        //2. 得到身份认证服务组件
        IdentityService identityService = engine.getIdentityService();

        //3. 创建用户
        String id = UUID.randomUUID().toString();
        UpdateUser.createUser(identityService,id,"angus","young","yangenxiong@163.com","abc");

        //4. 创建一个用户信息
        identityService.setUserInfo(id,"age","30");

        //5. 创建第二个用户信息
        identityService.setUserInfo(id,"weight","60KG");

        //删除用户年龄信息
        identityService.deleteUserInfo(id,"age");

    }

}
